import Vue from 'vue'
import VueRouter from 'vue-router'
// 使用现有的文件路径
import Layout from '../views/layout/Layout.vue'
import Login from '../views/login/login.vue'
import Home from '@/views/home/home.vue'
// import { checkout } from 'server/advert'

const Production = () => import('@/views/production/Production.vue')
const ProductionList = () => import('@/views/production/list/ProductList.vue')
const Category= () => import('@/views/production/category/Category.vue')



Vue.use(VueRouter)

const routes = [
{
    path: '/',
    name: 'MainLayout', // 路由名称使用多单词
    component: Layout,
    children:[
        {
            path:'/',
            name: 'HomeIndex', 
            component: Home
        },
          {
            path:'/Production',
            name: 'ProductionIndex', 
            component: Production,
            children: [
                {
                    path:'list',
                    name:'list',
                    component:ProductionList
                },
                {
                    path:'category',
                    name:'category',
                    component:Category
                }


            ]
        }
    ]
},
{
    path: '/login',
    name: 'UserLogin', // 路由名称使用多单词
    component: Login
}
]

const router = new VueRouter({  
    routes
})

export default router
